babl->format.loss = -1.0;
babl->format.visited = 0;
babl->format.image_template = NULL;
+ babl->format.format_n = 0;
return babl;
}
return babl_strdup (buf);
}
+static void
+babl_format_set_is_format_n (Babl *format)
+{
+ if (format->class_type == BABL_FORMAT)
+ {
+ format->format.format_n = 1;
+ }
+}
+
Babl *
babl_format_n (Babl *btype,
int components)
planar, components, model,
component, sampling, type);
+ babl_format_set_is_format_n (babl);
+
babl_db_insert (db, babl);
babl_free (name);
return babl;
}
+int
+babl_format_is_format_n (Babl *format)
+{
+ if (format->class_type == BABL_FORMAT)
+ {
+ return format->format.format_n;
+ }
+
+ return 0;
+}
+
+
static int
is_format_duplicate (Babl *babl,
int planar,
from and to RGBA double */
int visited; /* for convenience in code while searching
for conversion paths */
+ int format_n; /* whether the format is a format_n type or not */
} BablFormat;
#endif
babl_format_n (Babl *type,
int components);
+/**
+ * Returns whether the @format is a format_n type.
+ */
+int babl_format_is_format_n (Babl *format);
+
/**
* Defines a new conversion between either two formats, two models or
* two types in babl.